package cn.iocoder.yudao.module.infra.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * Bpm 消息的枚举
 *
 * @author 芋道源码
 */
@AllArgsConstructor
@Getter
public enum TicketTypeEnum {


    INSPECTION(1, "巡检"),
    MAINTENANCE(2, "保养"),
    REPAIR(3, "维修");

    private final int code;
    private final String desc;


    private static final Map<Integer, String> descMap = Arrays.stream(values())
            .collect(Collectors.toMap(e -> e.code, e -> e.desc));

    public static String getDescByCode(Integer code) {
        return descMap.getOrDefault(code, "未知类型");
    }
}
